<?php
include("../utility/connection.php");
include("../model/mSMS.php");
session_start();

if($_SERVER["REQUEST_METHOD"] == "POST") {
    $Tujuan = trim(mysql_real_escape_string($_POST["hidTujuan"]));
    $Pengirim = trim(mysql_real_escape_string($_POST["hidPengirim"]));
    $Sms = trim(mysql_real_escape_string($_POST["hidSMS"]));
    //echo '$Tujuan: '.$Tujuan.' $Pengirim: '.$Pengirim.' $Sms: '.$Sms;
    
    $result = fnGetReportSMSByAll($Tujuan, $Pengirim, $Sms);
    $count1 = mysql_num_rows($result);
    if ($count1 > 0) {
        $_SESSION['Tujuan']=$Tujuan;
        $_SESSION['Pengirim']=$Pengirim;
        $_SESSION['Sms']=$Sms;
        $_SESSION['reportSMS']='1';
        header("location: ../ui/admin/reportSms.php");
    } else {
        unset($_SESSION['Tujuan']);
        unset($_SESSION['Pengirim']);
        unset($_SESSION['Sms']);
        unset($_SESSION['reportSMS']);
        header("location: ../ui/admin/reportSms.php");
    }
}
?>
